package android.slc.filelibrary.ui.adapter;

import android.content.Context;

import androidx.annotation.LayoutRes;
import androidx.annotation.NonNull;

import android.slc.filelibrary.entity.BaseFile;
import android.slc.ma.MaBaseAdapter;

import java.util.List;

public abstract class BaseFileAdapter<T extends BaseFile> extends MaBaseAdapter<T> {

    public BaseFileAdapter(@NonNull Context context, @NonNull List<T> date, @LayoutRes int layoutId) {
        super(context, date, layoutId);
    }

    protected int getDefItemViewType(int position) {
        if (mData != null && !mData.isEmpty()) {
            return mData.get(position).getViewType();
        }
        return super.getItemViewType(position);
    }
}
